<template>
    <div>
        <div class="list" v-if="list.length==0" style="text-align:center;display:block">暂无消息</div>
        <div class="list" v-for="item in list" :key="item.value">
            <div class="list-icon" style="flex:0 0 10%">
                <i class="iconfont icon-icon-xiaoxi" style="font-size: 2rem"></i>
            </div>
            <div class="text" style="flex:0 0 75%">
                <p class="p1">您有一条{{item.title}}，将在{{getStr(item.createTime, 0,10)}}开始执行，{{item.content}}</p>
                <p class="p2">您有一条{{item.title}}，将在{{getStr(item.createTime, 0,10)}}开始执行，{{item.content}}</p>
            </div>
            <div class="time" style="flex:0 0 15%">
                {{getStr(item.createTime, 5,10)}}
                {{getStr(item.createTime, 11,16)}}
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            list: []
        }
    },
    mounted() {
        this.getList()
    },
    methods: {
        //获取列表
        getList() {
            this.$api.message.equip({
                pageNo: '1',
                pageSize: 999
            }).then(res => {
                if (res.success) {
                    this.list = res.data.list
                }
            });
        },
        //字符串截取
        getStr(str, a, b) {
            if (str != undefined) {
                return str.toString().substring(a, b)
            }
        },
    }
}
</script>

<style>
</style>
